-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] CORE-16353: Added flow tests using the Flow Testing Driver and fixed … #28
base: main
Are you sure you want to change the base?
Conversation
…a bug on the Accept smart contract Added flow tests using the Flow Testing Driver and fixed a bug on the Accept smart contract which I identified while executing the newly added flow tests. The bug was allowing proposers to accept their own proposals, for example, Alice issues £20 proposal to Bob, Bob modifies it to £20 and then accepts the modified proposal. Also. modified some of the dependencies to Corda 5.1 as that it what is compatible with the Flow Testing Driver. Obviously this code will not be merged until Corda 5.1 (and the Flow Testing Driver) is available publicly i.e. full GA. Also, updated the README.md file. Also, made changes to the flow classes to return the states' IDs instead of transaction IDs which were not being used anywhere. The returned states' IDs are required in flow tests to be able to test subsequent flows. Also, worth mentioning that I had to change the getter property for IsBuyer as for some weird reason Jackson renames it to just Buyer when serialising it and therefore breaking the flow tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Topic for discussion: Does this CorDapp sample have contract tests?
I'm wondering if the negative workflow tests you have would be better validated as contract tests - faster, focus attention to just contracts module tests and verify code?
...otiation-cordapp/contracts/src/main/java/com/r3/developers/samples/negotiation/Proposal.java
Outdated
Show resolved
Hide resolved
...lows/src/test/java/com/r3/developers/samples/negotiation/workflows/NegotiationFlowTests.java
Outdated
Show resolved
Hide resolved
...lows/src/test/java/com/r3/developers/samples/negotiation/workflows/NegotiationFlowTests.java
Outdated
Show resolved
Hide resolved
We have a separate JIRA for adding contract tests, same as Flow Testing Driver, those won't be merged until Contract Testing is available publicly. Flow Testing Driver also supports contract testing, this is to demonstrate that. |
Addressed code review comments
… re-added them to workflows build.gradle file Removed system properties from root build.gradle file and re-added them to workflows build.gradle file
Removed unused Trade constructor and renamed Trade.ProposalId to Trade.TradeId because that is what it is. Updated the Accept flow request body in the ReadMe file.
…a bug on the Accept smart contract
Added flow tests using the Flow Testing Driver and fixed a bug on the Accept smart contract which I identified while executing the newly added flow tests. The bug was allowing proposers to accept their own proposals, for example, Alice issues £20 proposal to Bob, Bob modifies it to £30 and then accepts the modified proposal. Also. modified some of the dependencies to Corda 5.1 as that it what is compatible with the Flow Testing Driver. Obviously this code will not be merged until Corda 5.1 (and the Flow Testing Driver) is available publicly i.e. full GA. Also, updated the README.md file. Also, made changes to the flow classes to return the states' IDs instead of transaction IDs which were not being used anywhere. The returned states' IDs are required in flow tests to be able to test subsequent flows. Also, worth mentioning that I had to change the getter property for IsBuyer as for some weird reason Jackson renames it to just Buyer when serialising it and therefore breaking the flow tests.